<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>车辆资产管理</title>
		<!--<link rel="stylesheet" href="../layui/css/layui.css" />
		<script type="text/javascript" src="../js/jquery-3.1.1.min.js"></script>-->
	</head>
	<body>
		<div class="layui-elem-quote">
			<span class="layui-breadcrumb">
				<a href="">首页</a>
				<a href="javascript:;">基础信息管理</a>
				<a href="javascript:;"><cite>数据字典信息管理</cite></a>
			</span>
		</div>
		<div>
			<form class="layui-form">
		        <div class="layui-inline">
			    	<label class="layui-form-label">字典项目：</label>
				    <div class="layui-input-inline">
					    <input type="text" id="" class="layui-input" />
				    </div>
		        </div>
		        <div class="layui-inline">
				    <label class="layui-form-label">所属类别：</label>
				    <div class="layui-input-inline">
					    <select id="selectId">
					     
			            </select>
				    </div>
		        </div>
	        	<div class="layui-inline">
	        		<a href="" class="layui-btn layui-btn-success" ><span class="layui-icon layui-icon-search"></span>搜索</a>
	        	</div>
	       </form>
	    </div>
		
		<div class="layui-card">
			<div class="layui-card-body">
				<table id="demo" lay-filter="test"></table>
			</div>
			<script type="text/html" id="buttonTpl">
				<a class="layui-btn layui-bg-blue layui-btn-xs" lay-event="detail">编辑</a>
				<a class="layui-btn layui-bg-yellow layui-btn-xs" lay-event="detail">删除</a>
            </script>
		</div>
	<script type="text/javascript" src="../js/jquery-3.4.1.min.js"></script>
	<script src="layui/layui.all.js"></script>
	<script>
			//注意：选项卡 依赖 element 模块，否则无法进行功能性操作
			layui.use(['element','form',"laypage",'table'],
			function() {
				var element = layui.element;
				var page = layui.laypage;
				var form = layui.form;
				var table=layui.table;
				//…
				page.render({
					elem:'page',
					count:50
					
				});
				 table.render({
				 	elem: '#demo'
                   ,height: 350
                   ,url: 'dataJSON/dataDicttable.json' //数据接口
                   ,page: true //开启分页
                   ,limit:5
                   ,limits:[5,10,15,20]
                   ,loading:false
                   ,done:function(res,curr,count){
                   	console.log(res,curr,count);
                   }
                   ,cols: [[ //表头
                   {field: 'id', title: '编码值', width:260, sort: true, fixed: 'left'}
                   ,{field: 'showValue', title: '显示值', width:260}
                   ,{field: 'class', title: '所属类别', width:260, sort: true}
                   ,{field: 'desc', title: '备注信息', width:260}
                   ,{field: 'stadus', title: '操作', width:324,height:30,templet:'#buttonTpl'}
                   ]]
			});
			
			//下拉选数据
		$(function(){	
			$.ajax({
				type:"get",
				url:"dataJSON/selectDict.json",
				success:function(result){
					var seoption="";
					$.each(result.select,function(index,value){
						seoption+="<option>"+value+"</option>";
					})
						$("#selectId").append(seoption);
						form.render();
				    }
			});
			})	
		});
			
		</script>
	</body>
</html>
